package com.easy.slurm.slurm.Jsch;

import com.jcraft.jsch.JSchException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author bing.bai
 * @create 2025/5/30
 */
@Component
public class JschConfig {

    @Value("${jsch.host}")
    private String host;

    @Value("${jsch.user}")
    private String user;

    @Value("${jsch.password}")
    private String password;

    @PostConstruct
    public void init() throws JSchException {
        if (StringUtils.isNotBlank(host)) {
            JschClient instance = JschClient.getInstance();
            instance.init(host,user,password);
        }
    }
}
